﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EZCRS.HCMS.Entity;
using EZCRS.HCMS.Data;

namespace EZCRS.HCMS.SqlClient
{
    /// <summary>
    /// 酒店类型
    /// </summary>
    public class sql_hcrs_proptype
    {
        /// <summary>
        /// 查询所有酒店类型信息
        /// </summary>
        /// <returns></returns>
        public List<HCRS_Proptype> getallproptype(int languagetype)
        {
            return ExecSql.GetTableList<HCRS_Proptype>("select * from HCRS_Proptype where languagetype=" + languagetype.ToString());
        }

        /// <summary>
        /// 删除单条信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool delproptype(int id)
        {
            if (ExecSql.SqlExecNoquery("delete from HCRS_Proptype where id=" + id.ToString() + "") > 0)
                return true;
            else
                return false;
        }

        /// <summary>
        /// 返回单条信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public HCRS_Proptype getitem(int id)
        {
            return new HCRS_Proptype(ExecSql.GetDataSet("select * from HCRS_Proptype where id=" + id.ToString()).Tables[0].Rows[0]);
        }

        /// <summary>
        /// 新增或修改数据
        /// </summary>
        /// <param name="_proptype"></param>
        /// <returns></returns>
        public bool insertorupdate(HCRS_Proptype _proptype)
        {
            return ExecSql.InsertOrUpdateData<HCRS_Proptype>(_proptype);
        }

    }
}
